package com.gitee.zhengjiasen.dp.state.demo2;

/**
 * 发放奖品
 */
public class DispenseState extends State {

    private Activity activity;

    public DispenseState(Activity activity) {
        this.activity = activity;
    }


    @Override
    void deduceMoney() {
        System.out.println("已经中奖, 不需要再次扣积分");
    }

    @Override
    boolean raffle() {
        System.out.println("已经中奖, 请领取奖品, 不需要再次抽奖");
        return false;
    }

    @Override
    void dispensePrize() {
        if (activity.getCount() > 0) {
            System.out.println("领取奖品成功.");
        } else {
            System.out.println("奖品已经领取完, 感谢参与!");
        }
    }
}
